package com.examstack.common.util.file;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 加载配置文件中的数据
 * 包括ftp配置
 * 消息队列名称
 * create date 2016-02-14
 */
public class PropertiesUtil{


	public static String debug;

	public static String ftp_host;
	public static Integer ftp_port;
	public static Boolean ftp_isPassiveMode;
	public static String ftp_username;
	public static String ftp_password;
	public static String uploadFtpUrl;
	public static String webFileUrl;
	public static String answersheet_data_queue;




	static {
		Properties prop = new Properties();
		InputStream in = PropertiesUtil.class.getResourceAsStream("/conf.properties");
		try {
			prop.load(in);
			debug = prop.getProperty("debug").trim();

			ftp_host = prop.getProperty("ftp.host").trim();
			ftp_port = Integer.valueOf(prop.getProperty("ftp.port").trim());
			ftp_isPassiveMode = Boolean.valueOf(prop.getProperty("ftp.isPassiveMode").trim());
			ftp_username = prop.getProperty("ftp.username").trim();
			ftp_password = prop.getProperty("ftp.password").trim();

			uploadFtpUrl = prop.getProperty("ftp.upload.exam.path").trim();
			webFileUrl = prop.getProperty("ftp.upload.web.exam.path").trim();
			answersheet_data_queue = prop.getProperty("answersheet.data.queue").trim();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
